package com.pine.dcts.utils;

import com.alibaba.druid.pool.DruidDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 *  用于如果应用异常杀掉  那么会保持job状态和数据传输位置 下次重新开始时 会重上次位置重新启动
 * @author xiaoyuan
 * @create 2020/10/22 11:03
 **/
@Configuration
@Slf4j
public class ApplicationListenerImpl implements ApplicationListener<ContextClosedEvent>, DisposableBean {
    @Override
    public void onApplicationEvent(ContextClosedEvent contextClosedEvent) {
       log.info("应用退出");
    }

    @Override
    public void destroy() throws Exception {
        log.info("应用退出1");
    }
}
